//
//  MIDIMycircleController.m
//  迷笛
//
//  Created by . on 2018/9/10.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIMycircleController.h"
#import "MIDIjoinController.h"
#import "MIDIcreateController.h"
#import "RCSegmentView.h"
@interface MIDIMycircleController ()
@property (nonatomic,retain) NSArray *viewControllers;


@end

@implementation MIDIMycircleController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIBarButtonItem *leftBarItem = [[UIBarButtonItem alloc] initWithTitle:nil style:UIBarButtonItemStylePlain target:self action:@selector(Block:)];
    self.navigationItem.leftBarButtonItem = leftBarItem;
    
    [self.navigationItem.leftBarButtonItem setImage:[[UIImage imageNamed:@"后退"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
    [self createVc];
}
// 返回上一级
-(void)Block:(UIButton * )sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = YES;
    self.navigationController.navigationBar.translucent = NO;//Bar的模糊效果，默认为YES

    self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"#171717"];
    self.title = @"我的圈子";
      [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FFFFFF"],NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:WidthScale(17)]}];
    //    去掉导航黑线
    UIImage *img = [UIImage imageNamed:@""];
    [self.navigationController.navigationBar setBackgroundImage:img  forBarMetrics:UIBarMetricsDefault];
    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
}
- (void)createVc
{
    
#define  HEIGHT [UIScreen mainScreen].bounds.size.height
#define  WIDTH  [UIScreen mainScreen].bounds.size.width
    
    MIDIjoinController * First=[[MIDIjoinController alloc]init];
    MIDIcreateController * Second=[[MIDIcreateController alloc]init];
    //    ThirdViewController * Third=[[ThirdViewController alloc]init];
    //    OneViewController *one =[[OneViewController alloc]init];
    NSArray *controllers=@[First,Second];
    
    NSArray *titleArray =@[@"我已加入的圈子",@"我创建的圈子"];
    RCSegmentView * rcs=[[RCSegmentView alloc]initWithFrame:CGRectMake(0,  kDevice_Is_iPhoneX?HeighX(0):HeightScale(0), WIDTH, HEIGHT) controllers:controllers titleArray:titleArray ParentController:self];
    [self.view addSubview:rcs];
}
@end
